package TestDemo14;

import java.util.Scanner;

public class Test {
    public static boolean isPrime(int a) {
        boolean isP = true;
        if (a == 1 || a == 2) return true;
        for (int i = 2; i < a; i++) {
            if (a % i == 0){
                isP = false;
                break;
            }
        }
        return isP;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] res=new int[2];
        res[0]=2;
        res[1]=num-2;
        //先找一个数，然后用num减去这个数，然后判断这个差是否是素数
        for (int i = 2; i < num/2; i++) {
            if (isPrime(i) && isPrime(num - i)) {
                if(res[1]-res[0] > num-2*i){
                    res[0]=i;
                    res[1]=num-i;
                }
            }
        }
        System.out.println(res[0]);
        System.out.println(res[1]);
    }
}
